import { request } from '../request';

/** get list */
export function menuList() {
  return request<Api.SystemManage.MenuList>({
    url: '/menu/list',
    method: 'get'
  });
}

/** save */
export function menuAdd(params: Api.SystemManage.MenuSaveParams) {
  return request<boolean>({
    url: '/menu/add',
    method: 'post',
    data: params
  });
}

/** update */
export function menuUpdate(params: Api.SystemManage.MenuUpdateParams) {
  return request<boolean>({
    url: '/menu/update',
    method: 'post',
    data: params
  });
}

/** get */
export function menuGet(params: { id: string }) {
  return request<Api.SystemManage.Menu & { parent: Api.SystemManage.Menu }>({
    url: '/menu/get',
    method: 'post',
    data: params
  });
}

/** del */
export function menuDel(params: { id: string }) {
  return request<boolean>({
    url: '/menu/del',
    method: 'post',
    data: params
  });
}
